#pragma GCC optimize(2)
#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
#include <bitset>
#define F first
#define S second
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int N=2e5+10;
ll n,x;
ll a[N];
ll sum[N];
int tr[N*2];
vector<ll> v;
ll lowbit(ll x)
{
	return x&(-x);
}

void add(ll x,ll k=1)
{
	for(int i=x;i<=v.size();i+=lowbit(i))
	{
		tr[i]+=k;
	}
}

ll query(ll x)
{
	ll res=0;
	for(int i=x;i>0;i-=lowbit(i))
	{
		res+=tr[i];
	}
	return res;
}

int find(ll x)
{
	return lower_bound(v.begin(),v.end(),x)-v.begin()+1;
}

void solve()
{
	cin>>n>>x;
	for(int i=1;i<=n;i++) cin>>a[i], sum[i]=sum[i-1]+a[i];
	for(int i=1;i<=n;i++)
	{
		v.push_back(sum[i]-x);
		v.push_back(sum[i]);
	}
    
	sort(v.begin(),v.end());
	v.erase(unique(v.begin(),v.end()),v.end());
    
	ll ans=0;
	add(find(0));
	for(int i=1;i<=n;i++)
	{
		int pos=find(sum[i]-x);
		ans+=query(pos);
		add(find(sum[i]));
	}
	cout<<ans;
}
int main()
{
	IOS;
	int T=1;
//	cin>>T;

	while(T--)
	{
		solve();
	}

	return 0;
}

